#pragma once
#include"Hash_bucket.h"
namespace Lin {
	template<class K>
	class Unordered_set {
	public:
		struct SetFunctor {
			const K& operator()(const  K& key) {
				return key;
			}
		};
		typedef typename HashBucket<K, const K, SetFunctor>::Iterator iterator;
		typedef typename HashBucket<K, const K, SetFunctor>::const_Iterator const_iterator;
		iterator begin() {
			return set_hb.begin();
		}
		iterator end() {
			return set_hb.end();
		}

		const_iterator begin() const{
			return set_hb.begin();
		}
		const_iterator end() const{
			return set_hb.end();
		}
		pair<iterator,bool> insert(const K& key) {
			return set_hb.insert(key);
		}
		bool find(const K& key) {
			if (set_hb.find(key)) {
				return true;
			}
			return false;
		}
		bool erase(const K& key) {
			return set_hb.erase(key);
		}
	private:
		HashBucket<K, const K, SetFunctor> set_hb;
	};
}